package com.kl.modular.system.service.impl;


import com.baomidou.mybatisplus.plugins.Page;
import com.kl.common.util.BeanMapperUtil;
import com.kl.modular.base.service.impl.BaseServiceImpl;
import com.kl.modular.system.dao.dto.ArticleContentDto;
import com.kl.modular.system.dao.mapper.ArticleContentMapper;
import com.kl.modular.system.dao.model.ArticleContent;
import com.kl.modular.system.service.api.IArticleContentService;
import com.kl.modular.system.service.bo.ArticleContentBo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章详情serviceImpl业务实现
 * @author xr_Yifan
 * @date 2017-12-12 08:52
 * @(C) xinrui Copyright 
 */
@Service
public class ArticleContentServiceImpl extends BaseServiceImpl<ArticleContentMapper, ArticleContent> implements IArticleContentService {

    public Page<ArticleContent> selectArticleContentPageByBo(Page<ArticleContent> page, ArticleContentBo bo){
        ArticleContentDto articleContentDto = BeanMapperUtil.map(bo, ArticleContentDto.class);
        List<ArticleContent> list = baseMapper.selectArticleContentPageByBo(articleContentDto,page);
        page.setRecords(list);
        return page;
    }
}
